# coding=utf-8
# author=haishan09@gmail.com
from django.contrib import admin
from report.models import Report, CutShip, CubeShip
from report.forms import CutShipFormSet


class CutShipInline(admin.TabularInline):

    model = CutShip 
    extra = 0
    template = 'admin/report/cutship_tabular.html'

    def get_formset(self, request, obj=None, **kwargs):
        return CutShipFormSet

class CubeShipAdmin(admin.ModelAdmin):

    model = CubeShip
   

class ReportAdmin(admin.ModelAdmin):

    model = Report 
    inlines = (CutShipInline, )
    template = 'admin/report/change_form.html'


admin.site.register(CubeShip, CubeShipAdmin)
admin.site.register(Report, ReportAdmin)
